<?php
/**
 * User: toozy <toozy@foxmail.com>
 * Date: 13-5-31
 * Time: 下午1:35
 */

class Controller {
    protected $_m = null;
    protected $_global = array();
    public function __construct(){
        if (func_num_args() == 1) {
            $this->_m = func_get_arg(0);
        }
        foreach ($this->_global as $k=>$v) {
            Bingo::g($k,$v);
        }
    }
    public function execute(){
        $this->_before();
        if ($this->_m) {
            Bingo::a($this->_m,$this)->init()->execute();
        } else {
            Bingo::a($this->_m)->init()->execute();
        }
        $this->_after();
    }
    protected function _before(){

    }
    protected function _after(){

    }
}